\(\int \frac {\cos ^3(c+d x)}{a+i a \tan (c+d x)} \, dx\) [112]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [F(-2)]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 67 \[ \int \frac {\cos ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {4 \sin (c+d x)}{5 a d}-\frac {4 \sin ^3(c+d x)}{15 a d}+\frac {i \cos ^3(c+d x)}{5 d (a+i a \tan (c+d x))} \]

[Out]

4/5*sin(d*x+c)/a/d-4/15*sin(d*x+c)^3/a/d+1/5*I*cos(d*x+c)^3/d/(a+I*a*tan(d*x+c))

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3583, 2713} \[ \int \frac {\cos ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=-\frac {4 \sin ^3(c+d x)}{15 a d}+\frac {4 \sin (c+d x)}{5 a d}+\frac {i \cos ^3(c+d x)}{5 d (a+i a \tan (c+d x))} \]

[In]

Int[Cos[c + d*x]^3/(a + I*a*Tan[c + d*x]),x]

[Out]

(4*Sin[c + d*x])/(5*a*d) - (4*Sin[c + d*x]^3)/(15*a*d) + ((I/5)*Cos[c + d*x]^3)/(d*(a + I*a*Tan[c + d*x]))

Rule 2713

Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[Expand[(1 - x^2)^((n - 1)/2), x], x], x
, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]

Rule 3583

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[a*(d*
Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/(b*f*(m + 2*n))), x] + Dist[Simplify[m + n]/(a*(m + 2*n)), Int[(d*Sec[
e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0] && NeQ[m + 2*n, 0] && IntegersQ[2*m, 2*n]

Rubi steps \begin{align*} \text {integral}& = \frac {i \cos ^3(c+d x)}{5 d (a+i a \tan (c+d x))}+\frac {4 \int \cos ^3(c+d x) \, dx}{5 a} \\ & = \frac {i \cos ^3(c+d x)}{5 d (a+i a \tan (c+d x))}-\frac {4 \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{5 a d} \\ & = \frac {4 \sin (c+d x)}{5 a d}-\frac {4 \sin ^3(c+d x)}{15 a d}+\frac {i \cos ^3(c+d x)}{5 d (a+i a \tan (c+d x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.43 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.07 \[ \int \frac {\cos ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=-\frac {\sec (c+d x) (-45+20 \cos (2 (c+d x))+\cos (4 (c+d x))+40 i \sin (2 (c+d x))+4 i \sin (4 (c+d x)))}{120 a d (-i+\tan (c+d x))} \]

[In]

Integrate[Cos[c + d*x]^3/(a + I*a*Tan[c + d*x]),x]

[Out]

-1/120*(Sec[c + d*x]*(-45 + 20*Cos[2*(c + d*x)] + Cos[4*(c + d*x)] + (40*I)*Sin[2*(c + d*x)] + (4*I)*Sin[4*(c
+ d*x)]))/(a*d*(-I + Tan[c + d*x]))

Maple [A] (verified)

Time = 1.27 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.25

method result size
risch \(\frac {i {\mathrm e}^{-5 i \left (d x +c \right )}}{80 a d}+\frac {i \cos \left (d x +c \right )}{8 a d}+\frac {5 \sin \left (d x +c \right )}{8 a d}+\frac {i \cos \left (3 d x +3 c \right )}{16 a d}+\frac {5 \sin \left (3 d x +3 c \right )}{48 a d}\) \(84\)
derivativedivides \(\frac {-\frac {i}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{2}}-\frac {1}{6 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{3}}+\frac {5}{8 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )}-\frac {i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {3 i}{2 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2}{5 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}-\frac {5}{3 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {11}{8 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}}{a d}\) \(141\)
default \(\frac {-\frac {i}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{2}}-\frac {1}{6 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{3}}+\frac {5}{8 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )}-\frac {i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {3 i}{2 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2}{5 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}-\frac {5}{3 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {11}{8 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}}{a d}\) \(141\)

[In]

int(cos(d*x+c)^3/(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/80*I/a/d*exp(-5*I*(d*x+c))+1/8*I/a/d*cos(d*x+c)+5/8*sin(d*x+c)/a/d+1/16*I/a/d*cos(3*d*x+3*c)+5/48/a/d*sin(3*
d*x+3*c)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.94 \[ \int \frac {\cos ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {{\left (-5 i \, e^{\left (8 i \, d x + 8 i \, c\right )} - 60 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 90 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 20 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 3 i\right )} e^{\left (-5 i \, d x - 5 i \, c\right )}}{240 \, a d} \]

[In]

integrate(cos(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/240*(-5*I*e^(8*I*d*x + 8*I*c) - 60*I*e^(6*I*d*x + 6*I*c) + 90*I*e^(4*I*d*x + 4*I*c) + 20*I*e^(2*I*d*x + 2*I*
c) + 3*I)*e^(-5*I*d*x - 5*I*c)/(a*d)

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 196 vs. \(2 (53) = 106\).

Time = 0.24 (sec) , antiderivative size = 196, normalized size of antiderivative = 2.93 \[ \int \frac {\cos ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\begin {cases} \frac {\left (- 30720 i a^{4} d^{4} e^{12 i c} e^{3 i d x} - 368640 i a^{4} d^{4} e^{10 i c} e^{i d x} + 552960 i a^{4} d^{4} e^{8 i c} e^{- i d x} + 122880 i a^{4} d^{4} e^{6 i c} e^{- 3 i d x} + 18432 i a^{4} d^{4} e^{4 i c} e^{- 5 i d x}\right ) e^{- 9 i c}}{1474560 a^{5} d^{5}} & \text {for}\: a^{5} d^{5} e^{9 i c} \neq 0 \\\frac {x \left (e^{8 i c} + 4 e^{6 i c} + 6 e^{4 i c} + 4 e^{2 i c} + 1\right ) e^{- 5 i c}}{16 a} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(d*x+c)**3/(a+I*a*tan(d*x+c)),x)

[Out]

Piecewise(((-30720*I*a**4*d**4*exp(12*I*c)*exp(3*I*d*x) - 368640*I*a**4*d**4*exp(10*I*c)*exp(I*d*x) + 552960*I
*a**4*d**4*exp(8*I*c)*exp(-I*d*x) + 122880*I*a**4*d**4*exp(6*I*c)*exp(-3*I*d*x) + 18432*I*a**4*d**4*exp(4*I*c)
*exp(-5*I*d*x))*exp(-9*I*c)/(1474560*a**5*d**5), Ne(a**5*d**5*exp(9*I*c), 0)), (x*(exp(8*I*c) + 4*exp(6*I*c) +
 6*exp(4*I*c) + 4*exp(2*I*c) + 1)*exp(-5*I*c)/(16*a), True))

Maxima [F(-2)]

Exception generated. \[ \int \frac {\cos ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate(cos(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 119 vs. \(2 (57) = 114\).

Time = 0.40 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.78 \[ \int \frac {\cos ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {\frac {5 \, {\left (15 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 13\right )}}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right )}^{3}} + \frac {165 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 480 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 650 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 400 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 113}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}^{5}}}{120 \, d} \]

[In]

integrate(cos(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

1/120*(5*(15*tan(1/2*d*x + 1/2*c)^2 + 24*I*tan(1/2*d*x + 1/2*c) - 13)/(a*(tan(1/2*d*x + 1/2*c) + I)^3) + (165*
tan(1/2*d*x + 1/2*c)^4 - 480*I*tan(1/2*d*x + 1/2*c)^3 - 650*tan(1/2*d*x + 1/2*c)^2 + 400*I*tan(1/2*d*x + 1/2*c
) + 113)/(a*(tan(1/2*d*x + 1/2*c) - I)^5))/d

Mupad [B] (verification not implemented)

Time = 5.73 (sec) , antiderivative size = 134, normalized size of antiderivative = 2.00 \[ \int \frac {\cos ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=-\frac {\left (-15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,15{}\mathrm {i}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,25{}\mathrm {i}-13\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,21{}\mathrm {i}+9\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+3{}\mathrm {i}\right )\,2{}\mathrm {i}}{15\,a\,d\,{\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )}^3\,{\left (1+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}\right )}^5} \]

[In]

int(cos(c + d*x)^3/(a + a*tan(c + d*x)*1i),x)

[Out]

-((9*tan(c/2 + (d*x)/2) + tan(c/2 + (d*x)/2)^2*21i - 13*tan(c/2 + (d*x)/2)^3 + tan(c/2 + (d*x)/2)^4*25i - 5*ta
n(c/2 + (d*x)/2)^5 + tan(c/2 + (d*x)/2)^6*15i - 15*tan(c/2 + (d*x)/2)^7 + 3i)*2i)/(15*a*d*(tan(c/2 + (d*x)/2)
+ 1i)^3*(tan(c/2 + (d*x)/2)*1i + 1)^5)